package com.langsin.crmpro.dao;

import org.hibernate.Query;

import com.langsin.crmpro.base.BaseDao;
import com.langsin.crmpro.model.SProvince;

public class ProvinceDaoImpl extends BaseDao  implements ProvinceDao{

	public SProvince getCities(Integer id) {
		try {
			String queryString = "from SProvince as sp where sp.id=?";
			Query queryObject = getSession().createQuery(queryString);
			queryObject.setParameter(0, id);
			if(queryObject.list().size() > 0){
				SProvince sp = (SProvince)queryObject.list().get(0);
				return sp;
			}else{
				return null;
			}
		} catch (RuntimeException re) {
			throw re;
		}
		
	}

}
